package com.shortvedio.media.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.shortvedio.base.mapper.VideosContentMapper;
import com.shortvedio.media.service.VideosContentService;
import com.shortvedio.base.model.po.VideosContent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class VideosContentServiceImpl implements VideosContentService {

    @Autowired
    private VideosContentMapper videosContentMapper;

    @Override
    public VideosContent getVideosContent(String vedioMd) {
        LambdaUpdateWrapper<VideosContent> videosContentLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
        videosContentLambdaUpdateWrapper.eq(VideosContent::getVideosMd,vedioMd);
        VideosContent videosContent = videosContentMapper.selectOne(videosContentLambdaUpdateWrapper);
        return videosContent;
    }

    @Override
    public Integer updateVideosContent(VideosContent videosContent) {
        int update = videosContentMapper.updateById(videosContent);
        return update;
    }
}
